package com.kadron.session;

import java.io.Serializable;

import com.kadron.base.KBase;

public class BasketItem extends KBase implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2104284006779850372L;
	
	private long itemId;

	private long itemColorId;
	private long itemSizeId;
	private long itemMaterialId;

	private int quantity;

	public BasketItem() {
		super();
	}

	public BasketItem(long itemId, long itemColorId, long itemSizeId,
			long itemMaterialId, int quantity) {
		super();
		this.itemId = itemId;
		this.itemColorId = itemColorId;
		this.itemSizeId = itemSizeId;
		this.itemMaterialId = itemMaterialId;
		this.quantity = quantity;
	}

	public long getItemId() {
		return itemId;
	}

	public void setItemId(long itemId) {
		this.itemId = itemId;
	}

	public long getItemColorId() {
		return itemColorId;
	}
	
	public void setItemColorId(long itemColorId) {
		this.itemColorId = itemColorId;
	}
	
	public long getItemSizeId() {
		return itemSizeId;
	}

	public void setItemSizeId(long itemSizeId) {
		this.itemSizeId = itemSizeId;
	}

	public long getItemMaterialId() {
		return itemMaterialId;
	}

	public void setItemMaterialId(long itemMaterialId) {
		this.itemMaterialId = itemMaterialId;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + (int) (itemColorId ^ (itemColorId >>> 32));
		result = prime * result + (int) (itemId ^ (itemId >>> 32));
		result = prime * result
				+ (int) (itemMaterialId ^ (itemMaterialId >>> 32));
		result = prime * result + (int) (itemSizeId ^ (itemSizeId >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BasketItem other = (BasketItem) obj;
		if (itemColorId != other.itemColorId)
			return false;
		if (itemId != other.itemId)
			return false;
		if (itemMaterialId != other.itemMaterialId)
			return false;
		if (itemSizeId != other.itemSizeId)
			return false;
		return true;
	}

}
